import request from '@/utils/request'
export default {
    //1 添加课程信息
    addCourseInfo(courseInfo) {
        return request({
            url: '/eduservice/course/addCourseInfo',
            method: 'post',
            data:courseInfo
          })
    },
    //2 查询所有讲师
    getListTeacher() {
        return request({
            url: '/eduservice/teacher/teachers',
            method: 'get'
          })
    },
    //3 根据课程id查询课程基本信息
    getCourseInfoId(courseId) {
        return request({
            url: '/eduservice/course/getCourseInfo/'+courseId,
            method: 'get'
          })
    },
    updateCourseInfo(courseInfo) {
        return request({
            url: '/eduservice/course/updateCourseInfo',
            method: 'post',
            data:courseInfo
          })
    },
    //课程确认信息显示
    getPublihCourseInfo(id) {
        return request({
            url: '/eduservice/course/getPublishCourseInfo/'+id,
            method: 'get'
          })
    },
    //课程最终发布
    publihCourse(id) {
        return request({
            url: '/eduservice/course/publishCourse/'+id,
            method: 'post'
          })
    },
    
    getListCourse(current,limit,courseQuery) {
        return request({
            url: `/eduservice/course/course/${current}/${limit}`,
            method: 'post',
            // data:表示将对象转为json传递给后端
            data:courseQuery
          })
    },
    deleteCourse(id){
        return request({
            url: `/eduservice/course/${id}`,
            method: 'delete',
        })
    },
}
